﻿<core:ViewBase  x:Class="DXTools.UI.Modules.Configuration.Views.InstalledToolsView"
    xmlns:core="clr-namespace:DXTools.UI.Core.View;assembly=DXTools.UI.Core"
    xmlns:AttachedProperties="clr-namespace:DXTools.UI.Core.AttachedProperties;assembly=DXTools.UI.Core"
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
    xmlns:layout="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit"
    xmlns:metadata="clr-namespace:DXTools.UI.Modules.Configuration"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="800" Margin="5,5,15,5">
    <toolkit:BusyIndicator IsBusy="{Binding IsBusy}">
        <Grid x:Name="LayoutRoot">
            <Grid.RowDefinitions>
                <RowDefinition Height="33" ></RowDefinition>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            <StackPanel Grid.Row="0" Background="DarkGray" VerticalAlignment="Stretch">
                <Border CornerRadius="5" Margin="2,3,1,2" Background="White" HorizontalAlignment="Left" BorderBrush="#C0CDDC" BorderThickness="0">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="200"/>
                            <ColumnDefinition Width="24" />

                        </Grid.ColumnDefinitions>

                        <TextBox Grid.Column="0" Margin="0"  Text="{Binding Path=SearchText, Mode=TwoWay}" 
                            AttachedProperties:EnterKeyDown.Command="{Binding SearchCommand}" 
                            AttachedProperties:EnterKeyDown.CommandArgument="{Binding Path=Text,RelativeSource={RelativeSource Self}}"
                            BorderThickness="0" HorizontalAlignment="Left" VerticalAlignment="Center" Name="uxSearchText"  Width="200" Height="20"/>
                            
                        <Button  Grid.Column="1"  Margin="0"                    
                        Command="{Binding SearchCommand}" BorderThickness="0" ToolTipService.ToolTip="Search" >
                            <Button.Content>
                                <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" VerticalAlignment="Center" >
                                    <Image Source="../Images/search.png"   Width="21" Height="20" />
                                </StackPanel>
                            </Button.Content>
                        </Button>
                    </Grid>
                </Border>
            </StackPanel>
            <data:DataGrid Grid.Row="1" ItemsSource="{Binding FilteredToolList}"  AutoGenerateColumns="False" HorizontalAlignment="Stretch"  Name="datagridAvailableTools" VerticalContentAlignment="Top">
                <data:DataGrid.Columns>
                    <data:DataGridTextColumn   Header="Display Name" Binding="{Binding DisplayName}" Width="300" IsReadOnly="True" />
                    <data:DataGridTextColumn   Header="Current Version" Binding="{Binding Version}" Width="200" IsReadOnly="True" />
                    <data:DataGridTextColumn   Header="Latest Version" Binding="{Binding NewVersion}" Width="200" IsReadOnly="True" />
                    </data:DataGrid.Columns>
            </data:DataGrid>
        </Grid>
    </toolkit:BusyIndicator>
</core:ViewBase>
